package com.yuju.account.enums;


public enum ShiftReturnCodeEnum {
    SHIFT_GET_PRE_SUCCESS("yuju-shift-1001", "预交班获取成功"),
    SHIFT_GET_PRE_FAILURE("yuju-shift-1002", "预交班获取失败"),
    SHIFT_ADD_SUCCESS("yuju-shift-1003", "交班提交成功"),
    SHIFT_ADD_FAILURE("yuju-shift-1004", "交班提交失败"),
    SHIFT_GET_INFO_SUCCESS("yuju-shift-1005", "交班信息获取成功"),
    SHIFT_GET_INFO_FAILURE("yuju-shift-1006", "交班信息获取失败"),
    SHIFT_QUERY_IFNO_SUCCESS("yuju-shift-1007", "查询交班信息成功"),
    SHIFT_QUERY_IFNO_FAILURE("yuju-shift-1008", "查询交班信息失败"),
    SHIFT_QUERY_ACCOUNT_SUCCESS("yuju-shift-1009", "查询交班账务成功"),
    SHIFT_QUERY_ACCOUNT_FAILURE("yuju-shift-1010", "查询交班账务失败"),
    SHIFT_HOTEL_INIT_FAILURE("yuju-shift-1011", "初始化酒店交班信息失败"),
    SHIFT_GET_SHIFT_CODE_SUCCESS("yuju-shift-1012", "查询班次号成功"),
    SHIFT_GET_SHIFT_CODE_FAILURE("yuju-shift-1013", "查询班次号失败");

    private String code;
    private String desc;

    ShiftReturnCodeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getDescByCode(String code) {
        for (SettleAccountReturnCodeEnum enume : SettleAccountReturnCodeEnum.values()) {
            if (enume.getCode().equals(code)) {
                return enume.getDesc();
            }
        }

        return "未知枚举类型";
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
